﻿using MenuService.Public;
using StudentsPrenseLog.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentsPrenseLog
{
    public class Application
    {
        private StudentService _studentsService;

        public Application()
        {
            _studentsService = new StudentService(new Repositories.StudentRepository());
        }

        public void Exit()
        {
            Environment.Exit(0);
        }

        public void Start()
        {
            MenuControlFacade menu = new MenuControlFacade("Menu.txt");
            menu.BindMethod("4", Exit);
            menu.BindMethod("1.1", _studentsService.CreateStudent);
            menu.PrintMenu2Console();
            menu.StartInputListening();
        }
    }
}
